package com.foreknow.demo7;

import java.util.Scanner;

public class TestPerson {
    public void m1(Person person){
        System.out.println(person.name);
        person.eat();
    }

    public Person m2(){
        Person a =new Person();
        a.name = "fender";
        return a;
    }
    public int m3(){
        int a =3;
        return a;
    }
    public String m4(){
        String s = "abc";
        return s;
    }
    public Scanner m5(){
        Scanner input = new Scanner(System.in);
        return input;
    }

    public static void main(String[] args) {
        TestPerson testPerson = new TestPerson();//创建对象
        Person p =new Person();
        testPerson.m1(p);
        Person person = testPerson.m2();
        System.out.println(person.name);
        int n =testPerson.m3();
        System.out.println(n);
        String ss =testPerson.m4();
        System.out.println(ss);
        Scanner sss = testPerson.m5();
        System.out.println("请输入一个整数");
        int num =sss.nextInt();
        System.out.println(num);
     }
}
